package com.jv.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jv.dao.ProductDao;
import com.jv.entity.Product;
import com.jv.service.IProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;

/**
 * productService商品实现类
 * @author Jv
 * @version 1.0
 */
@Service("productService")
public class IProductServiceImpl extends ServiceImpl<ProductDao, Product> implements IProductService{
    @Autowired
    private ProductDao productDao;

    @Override
    public List<Product> list(HashMap<String, Object> map) {
        return productDao.list(map);
    }

    @Override
    public Long getTotals(HashMap<String, Object> map) {
        return productDao.getTotal(map);
    }

    @Override
    public void add(Product product) {
        productDao.add(product);
    }

    @Override
    public void update(Product product) {
        productDao.update(product);
    }

    @Override
    public Product findById(Integer id) {
        return productDao.findById(id);
    }
}
